package org.etlt.check;

import org.apache.commons.lang3.StringUtils;
import org.etlt.job.JobContext;

public abstract class CheckPoint {
    public static final String CR = "\r\n";

    private final CheckPointSetting setting;

    private final CheckList checkList;

    public CheckPoint(CheckPointSetting setting, CheckList checkList){
        this.setting = setting;
        this.checkList = checkList;
    }

    public String getName(){
        return this.setting.getName();
    }

    public CheckList getCheckList(){
        return this.checkList;
    }

    public CheckPointSetting getSetting() {
        return setting;
    }

    public abstract CheckResult check(JobContext context);

    public abstract String getDetail(JobContext context);

    protected String normalize(String input){
        return StringUtils.isEmpty(input) ? "" : input;

    }
}
